  /******************************************************************************
  * @file    PT32X005_rcc.h
  * @author  应用开发团队
  * @version V1.1.0
  * @date    2020/1/27
  * @brief    This file contains all the functions prototypes for the SYS firmware library.
  *
  ******************************************************************************
  * @attention
  *
  *
  *****************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef PT32X005_RCC_H
#define PT32X005_RCC_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "PT32X005.h"


/** @addtogroup SYSTEM CONTROL
  * @{
  */



#define IS_RSTCU_FLAG(FLAG)	((FLAG == RCC_RSR_SFR)    || \
							(FLAG == RCC_RSR_IWDGR)   || \
							(FLAG == RCC_RSR_PLLR)    || \
							(FLAG == RCC_RSR_POR)     || \
							(FLAG == RCC_RSR_PINR)    || \
							(FLAG == RCC_RSR_PVDR))


#define IS_RSTEN_SOURCE(SOURCE)    ((SOURCE == RCC_RSR_SFR)   || \
									(SOURCE == RCC_RSR_IWDGR)    || \
									(SOURCE == RCC_RSR_PLLR)    || \
									(SOURCE == RCC_RSR_POR)   || \
									(SOURCE == RCC_RSR_PINR)   || \
									(SOURCE == RCC_RSR_PVDR))


/* Exported macro ------------------------------------------------------------*/
/* Exported functions ---------------------------------------------------------*/
u32 RCC_GetSYSCLKFreq(void);
FlagStatus RCC_GetResetFlagStatus(u32 RSTCU_RSTF);
void RCC_ClearResetFlag(u32 RSTCU_RSTF);
void RCC_RestConfig(u32 RstSource, FunctionalState NewState);
/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif


